how to determine the order of a matrix